#!/bin/sh
# excavator-generator: generate services needed for excavator operation

# 没有标注excavator.enable时，不做任何操作
if [ ! -f "/excavator.enable" ];then
  exit 0
fi

# set up dirs
systemd_dir="/usr/lib/systemd/system"
target_dir="$systemd_dir/excavator.target.wants"
mkdir -p $target_dir
#ln -sf "$systemd_dir/excavator.service" "$target_dir/excavator.service"
ln -sf "$systemd_dir/excavator.target" "$2/default.target"